#include <KApplication>
#include <KAboutData>
#include <KCmdLineArgs>
 
#include "mainwindow.h"
#include "kdebug.h"

// Debug level for the program
int global_debug = 1;
 
int main (int argc, char *argv[])
{
    
    global_debug=1;
    KAboutData aboutData( "klostcities", "klostcities",
        ki18n("KLostCities"), "0.1",
        ki18n("A card game of exploration"),
        KAboutData::License_GPL,
        ki18n("Copyright (c) 2008 Emmanuel Teyssier") );
    KCmdLineArgs::init( argc, argv, &aboutData );
  
    KCmdLineOptions options;
    options.add("debug <level>", ki18n("Enter debug level"));
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

    
    /* command line handling */
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    
    // Check for debug command line option
    if (args->isSet("debug"))
    {
        global_debug=QString(args->getOption("debug")).toInt();

    }
    kDebug() << "Debug level set to" << global_debug;
  
    KApplication app;
    
    kDebug() << "Kapp Created";
 
    MainWindow* window = new MainWindow();
    window->show();
    
    kDebug() << "Main Window Created";
    return app.exec();
}
